package concurso.practica;

import java.util.Scanner;

public class king {
	static Scanner lector = new Scanner(System.in);
	static int a, b, c;
	static String[] cadena;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		while (true) {
			cadena = lector.nextLine().split(" ");
			a = Integer.parseInt(cadena[0]);
			b = Integer.parseInt(cadena[1]);
			c = Integer.parseInt(cadena[2]);

			if (a == b && b == c) {
				if (a < 13 && a > 0) {
					System.out.println((a + 1) + " " + (b + 1) + " " + (c + 1));
				} else if (a == 0) {
					break;
				} else {
					System.out.println("*");
				}
			} else if (a == b && b != c) {
				if (c < 12) {
					if (c + 1 == a)
						System.out.println((a) + " " + (b) + " " + (c + 2));
					else if (c < a)
						System.out.println((c + 1) + " " + (a) + " " + (b));
					else
						System.out.println((a) + " " + (b) + " " + (c + 1));
				} else {
					if (c == 12)
						if (a == 13)
							System.out.println((1) + " " + (1) + " " + (1));
						else
							System.out.println((a) + " " + (b) + " " + (c + 1));
					else
						System.out.println((1) + " " + (a + 1) + " " + (b + 1));
				}
			} else if (a == c && c != b) {
				if (b < 12) {
					if (b + 1 == a && b + 1 < 13)
						System.out.println((a) + " " + (c) + " " + (b + 2));
					else if (b < a)
						System.out.println((b + 1) + " " + (a) + " " + (c));
					else
						System.out.println((a) + " " + (c) + " " + (b + 1));
				} else {
					if (b == 12)
						if (a == 13)
							System.out.println((1) + " " + (1) + " " + (1));
						else
							System.out.println((a) + " " + (c) + " " + (b + 1));
					else
						System.out.println((1) + " " + (c + 1) + " " + (a + 1));
				}
			} else if (b == c && c != a) {
				if (a < 12) {
					if (a + 1 == b)
						System.out.println((b) + " " + (c) + " " + (a + 2));
					else if (b < a)
						System.out.println((a + 1) + " " + (b) + " " + (c));
					else
						System.out.println((b) + " " + (c) + " " + (a + 1));
				} else {
					if (a == 12)
						if (b == 13)
							System.out.println((1) + " " + (1) + " " + (1));
						else
							System.out.println((b) + " " + (c) + " " + (a + 1));
					else
						System.out.println((1) + " " + (c + 1) + " " + (b + 1));
				}
			} else {
				System.out.println((1) + " " + (1) + " " + (2));
			}
		}
	}
}
